package ui.activity.mine;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Button;
import android.widget.TextView;

import com.jakewharton.rxbinding.view.RxView;

import net.ck.hzq.R;
import net.ck.hzq.TobuyApplication;

import java.text.DecimalFormat;
import java.util.concurrent.TimeUnit;

import base.BaseAct;
import butterknife.BindView;
import event.NetErrorEvent;


/**
 * 提现成功界面
 * Created by chenjian on 2017/8/4.
 */

public class ForwardAct extends BaseAct {


    @BindView(R.id.forward_txt1)
    TextView totalMoney;
    @BindView(R.id.forward_txt2)
    TextView money;
    @BindView(R.id.forward_txt3)
    TextView cardNumber;
    @BindView(R.id.forward_but)
    Button submit;
    @BindView(R.id.shuifei)
    TextView shuifei;


    DecimalFormat df = new DecimalFormat("0.00");

    @Override
    protected void setRoot() {
//        setTitleBar(R.color.colorBlue);
        setContentView(R.layout.activity_forward);
    }

    @Override
    protected void setup() {
        setToolBar(getResources().getString(R.string.myincome2), "");
    }

    @Override
    protected void init(@Nullable Bundle savedInstanceState) {
        try {
            double Moeny = Double.valueOf(getIntent().getStringExtra("money"));
            totalMoney.setText("¥ " + getIntent().getStringExtra("money"));
            String str = getIntent().getStringExtra("card");
            str = str.replace("(", "  尾号");
            str = str.replace(")", "");
            cardNumber.setText(str);
            shuifei.setText(TobuyApplication.resultBeans.get(1).getValue());

            money.setText(TobuyApplication.resultBeans.get(2).getValue());
        } catch (Exception e) {

        }
        RxView.clicks(submit)
                .compose(this.<Void>bindToLifecycle())
                .throttleFirst(500, TimeUnit.MILLISECONDS)
                .subscribe(Void -> finish());
    }

    @Override
    public void onNetErrorEvent(NetErrorEvent event) {
        super.onNetErrorEvent(event);
    }

    @Override
    protected void onNetError(NetErrorEvent event) {

    }

}
